package com.gzq.builder.practice;

import java.util.Arrays;
import java.util.List;

public class Director {

    private Builder builderA = new BuilderA();
    private Builder builderB = new BuilderB();

    public ProductA createProductA1(){
        ProductA product = (ProductA) builderA.createProduct();
        List<String> indexes = Arrays.asList("lighting","whistle","boom");
        product.setIndexes(indexes);
        return product;
    }

    public ProductA createProductA2(){
        ProductA product = (ProductA) builderA.createProduct();
        List<String> indexes = Arrays.asList("lighting","boom","whistle");
        product.setIndexes(indexes);
        return product;
    }

    public ProductB createProductB1(){
        ProductB product = (ProductB) builderB.createProduct();
        List<String> indexes = Arrays.asList("lighting","whistle","boom");
        product.setIndexes(indexes);
        return product;
    }

    public ProductB createProductB2(){
        ProductB product = (ProductB) builderB.createProduct();
        List<String> indexes = Arrays.asList("lighting","boom","whistle");
        product.setIndexes(indexes);
        return product;
    }

}
